<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/page/user/gerenHeader.jsp" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的饿单 | 饿9订 </title>
<script src="<%=basePath %>js/jquery-2.0.3.min.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=basePath%>js/tablecreate/jlinq.js"></script>
<script type="text/javascript" src="<%=basePath%>js/tablecreate/jquery-dynamicTable.js"></script>
<script type="text/javascript" src="<%=basePath%>js/tablecreate/pager.js"></script> 

<style type="text/css">
*{
font-family: '微软雅黑',
}
</style>
<sb:head/>
</head>
<body style="background-image: url(<%=basePath%>image/info.jpg)">
<s:hidden id="orderId" value="%{order.orderId}"></s:hidden>
<div style="width: 760px;height: 550px;margin: 0px auto;background-color:white ">
<div style="width: 760px;height: 40px;border-bottom:1px solid #C0C0C0;">
<div style="width: 250px;height: 40px;float:left;font-size:15px; ">收货人：<s:property value="order.userName"/> </div>
<div style="width: 250px;height: 40px;float:left;font-size:15px; ">收货地址：<s:property value="order.userAddress"/></div>
<div style="width: 250px;height: 40px;float:left;font-size:15px; ">联系电话：<s:property value="order.userPhone"/></div>
</div>
<div style="width: 760px;height: 40px;border-bottom:1px solid #C0C0C0;">
<div style="width: 250px;height: 40px;float:left;font-size:15px;">下单时间：<s:property value="order.orderDate"/> </div>
<div style="width: 250px;height: 40px;float:left;font-size:15px; ">预计45分钟内送达<s:property value=""/></div>
<div style="width: 250px;height: 40px;float:left;font-size:15px; "><a href="javascript:void(0)" onclick="">取消订单</a></div>
</div>
<div style="width: 760px;height: 510px;" id="lists" >
<div id="list" ></div>
<div id="page"></div>
</div>
<script type="text/javascript">

var orderId=$("#orderId").val();
var url=[{loadUrl:"order_getOrderItemList?orderId="+orderId}];//请求地址
var postData={};
var pageId="page";
var objClassName="list_light";
var objColumn = [
					{ ColumnName: "菜单名称", DataId: "menuName", Width: 200, DataAlign: "left", Format: null, OnClick: null },
					{ ColumnName: "数量", DataId: "menuNum", Width: 100, DataAlign: "left", Format: null, OnClick: null },
					{ ColumnName: "单价", DataId: "menuNowPrice", Width: 100, DataAlign: "left", Format: null, OnClick: null },
					{ ColumnName: "金额", DataId: "profit", Width:200, DataAlign: "left", Format: null, OnClick: null },
                 ];

	   $.ajax({
			type: "post",
	        url: url[0].loadUrl,
	        data: postData,
	        dataType: "json",
	        success: function(data){
          var objData = new Array(data.list.length);
          for(var i=0;i<data.list.length;i++){
       	  objData[i]={menuName:data.list[i].menuName,
       			     menuNum:data.list[i].menuNum,menuNowPrice:data.list[i].menuNowPrice,
       			     profit:data.list[i].profit}; 
              }
               $("#list").MakeTable(objColumn, objData, objClassName);
        	  //$("#page").MakePage(data.page[0]);
		        }
			});
	   
function searchList(){
	var page=$("#selPage").val();
	var pageRow=$("#selRow").val();
	postData={menuName:$("#menuName").val(),type:$("#type").val(),status:$("#status").val(),initPage:page,pageRow:pageRow};
	comMenuList();
}
var j=0;
function OrderSort(order){
	var order=order;
	j++;
	if(j%2==0){
          var sort="desc";
		}else if (j%3==0) {
			var sort="asc";
		}else{
      order="created";
      var sort="desc";
			}
	var page=$("#selPage").val();
	var pageRow=$("#selRow").val();
	postData={menuName:$("#menuName").val(),menuType:$("#type").val(),status:$("#status").val(),order:order,sort:sort,initPage:page,pageRow:pageRow};
	comMenuList();
}
function goPage(){
	var page=$("#selPage").val();
	var pageRow=$("#selRow").val();
	postData={menuName:$("#menuName").val(),menuType:$("#type").val(),status:$("#status").val(),initPage:page,pageRow:pageRow};
	comMenuList();
}
function changePage(page){
	var pageRow=$("#selRow").val();
	postData={menuName:$("#menuName").val(),menuType:$("#type").val(),status:$("#status").val(),initPage:page,pageRow:pageRow};
	comMenuList();
}
function goRow(){
	var pageRow=$("#selRow").val();
	var page=$("#selPage").val();
	comMenuList();
}


</script>
</div>
</body>
<%@ include file="/page/user/userFooter.jsp"%>
</html>